<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr1 = [0, 1, 2, 3, 4, 5]
        let arr2 = [0, 4, 6, 1, 3, 9]
        let arr3 = []
        for (let i = 0; i < arr1.length; i++) {
            for (let j = 0; j < arr2.length; j++) {
                if (arr1[i] == arr2[j]) {
                    arr3.push(arr1[i], arr2[j])
                }
            }
        }
        console.log(arr3);
    </script>
</body>

</html>